package com.zxy.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author: Zxy
 * @description:
 * @date: 2021-07-19 18:22
 */
@Configuration
public class RestTemplateConfig {

    @Bean
    @LoadBalanced // 将restTemplate具有负载均衡的功能
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
